<?php
$ArPerguntas = Dracosys::getSessionValue(SESSION_INTERFACE, 'QuestionsList');
?>
<section id="QuestionList">
    <h2>Perguntas Frequentes</h2>
    <table id="QuestionList_question" class="list">
        <thead>
            <tr>
                <th>Título</th>
                <th>Usuario</th>
                <th>Visualizar</th>
                <th>Editar</th>
                <th>Deletar</th>
            </tr>
        </thead>
        <tfoot>
        </tfoot>
        <tbody>
            <?php
            if( !empty($ArPerguntas) ):
                foreach($ArPerguntas as $Question): ?>
                <tr>
                    <td><?=$Question->getStTitulo()?></td>
                    <td><?=$Question->getUsuario()->getArDadosUsuario('StNome')?></td>
                    <td>
                        <a href="<?=DRA_URL?>faq/visualizar/id/<?=$Question->getIDFaq()?>" title="Visualizar">
                            <img src="<?= DRA_VIEW_URL ?>images/descricao.png" />
                        </a>
                    </td>
                    <td>
                        <a href="<?=DRA_URL?>faq/editar/id/<?=$Question->getIDFaq()?>" title="Editar">
                            <img src="<?= DRA_VIEW_URL ?>images/edit.png" />
                        </a>
                    </td>
                    <td>
                        <a href="<?=DRA_URL?>faq/deletar/id/<?=$Question->getIDFaq()?>" title="Excluir" id="QuestionList_delete<?=$Question->getIDFaq()?>">
                            <img src="<?= DRA_VIEW_URL ?>images/delete.png" />
                        </a>
                    </td>
                </tr>
            <?php
                endforeach;
            else:
            ?>
                <tr class="nodata">
                    <td colspan="5">
                        Nenhum resultado foi encontrado!
                    </td>
                </tr>
            <?php
            endif;
            ?>
        </tbody>
    </table>
    <div class="insertInList">
        <a href="<?=DRA_URL?>faq/cadastrar" class="insertIcon">Nova Pergunta</a>
    </div>
</section>